#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int letter = 0;
	int blank = 0;
	int digit = 0;
	int other = 0;
	char c;
	while (c=getchar()!='\n')
	{
		
		if (c >= '0' && c <= '9')
			digit++;
		else if ((c>= 'a' && c <= 'z') || (c>='A' && c<='Z'))
			letter++;
		else if (c == ' ')
			blank++;
		else
			other++;
	}
	printf("%d %d %d %d", digit, letter, blank, other);

	return 0;
}